package com.example.a2306_shop.adapter

import android.widget.CheckBox
import android.widget.Checkable
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.a2306_shop.R
import com.example.lib_base.entity.Cart
import com.example.user.GlideUtils

class CartAdapter:BaseQuickAdapter<Cart,BaseViewHolder>(R.layout.item_cart) {
    override fun convert(holder: BaseViewHolder, item: Cart) {
        holder.getView<CheckBox>(R.id.cart_cb).isChecked = item.isChecked
        GlideUtils.loadNormal(context,item.image,holder.getView(R.id.cart_image))
        holder.setText(R.id.cart_name,item.storeName)
        holder.setText(R.id.cart_suk,"规格:${item.suk}")
        holder.setText(R.id.cart_price,"￥${item.price}")
        holder.setText(R.id.cart_num,item.cartNum.toString())
    }
}